// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 添加接口 POST /api/addApi */
export async function addApiUsingPost(
  body: dataFactory.AddApiDTO,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/api/addApi', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 添加接口分类 POST /api/addApiCategory */
export async function addApiCategoryUsingPost(
  body: dataFactory.AddApiCategory,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/api/addApiCategory', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 添加接口信息 POST /api/addApiInformation */
export async function addApiInformationUsingPost(
  body: dataFactory.AddApiInformation,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/api/addApiInformation', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量修改接口状态 PUT /api/batchApiRelease */
export async function batchApiReleaseUsingPut(
  body: dataFactory.UpdateBatchApiDTO,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/api/batchApiRelease', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除接口 DELETE /api/deleteApi/${param0} */
export async function deleteApiUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: dataFactory.deleteApiUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { apiId: param0, ...queryParams } = params;
  return request<dataFactory.R>(`/api/deleteApi/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 删除接口分类 DELETE /api/deleteApiCategory/${param0} */
export async function deleteApiCategoryUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: dataFactory.deleteApiCategoryUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { classificationId: param0, ...queryParams } = params;
  return request<dataFactory.R>(`/api/deleteApiCategory/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取接口分类 GET /api/getApiCategory */
export async function getApiCategoryUsingGet(options?: { [key: string]: any }) {
  return request<dataFactory.R>('/api/getApiCategory', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 查看接口详情 GET /api/getApiDetail/${param0} */
export async function getApiDetailUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: dataFactory.getApiDetailUsingGETParams,
  options?: { [key: string]: any },
) {
  const { apiId: param0, ...queryParams } = params;
  return request<dataFactory.R>(`/api/getApiDetail/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 查询接口列表 POST /api/getApiList */
export async function getApiListUsingPost(
  body: dataFactory.QueryApiDTO,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/api/getApiList', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改接口分类 PUT /api/putApiCategory */
export async function updateApiCategoryUsingPut(
  body: dataFactory.UpdateApiCategory,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/api/putApiCategory', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改接口 PUT /api/updateApi */
export async function updateApiUsingPut(
  body: dataFactory.UpdateApiDTO,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/api/updateApi', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
